package com.example.module_main.guide

import android.media.Image
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import androidx.recyclerview.widget.RecyclerView
import com.example.module_main.R

/**
 * @author yaotianxue
 * @description
 * @date 2025/1/16
 */
class GuidePageAdapter:RecyclerView.Adapter<GuidePageAdapter.GuidePageViewHolder>() {
    private val guidePicRes = listOf(R.mipmap.bg_guide_1,R.mipmap.bg_guide_2,R.mipmap.bg_guide_3)
    override fun getItemCount(): Int {
        return guidePicRes.size
    }
    override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): GuidePageViewHolder {
        val view =
            LayoutInflater.from(parent.context).inflate(R.layout.item_guide_page, parent, false)
        return GuidePageViewHolder(view)
    }

    override fun onBindViewHolder(holder: GuidePageViewHolder, position: Int) {
        val imageView = holder.itemView.findViewById<ImageView>(R.id.iv)
        imageView.scaleType = ImageView.ScaleType.CENTER_CROP
        imageView.setImageResource(guidePicRes[position])
    }


    inner class GuidePageViewHolder(itemView:View):RecyclerView.ViewHolder(itemView){

    }


}